<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <h1>hello world</h1>
    <div id="app">
        你好{{msg}}
        <br/>
        <button @click="butf(10086)">点击调用f1方法</button>
        <button @click="butf($event, 10086)">点击调用，传参数，传event</button>
        <br/>
        <a href="https://www.baidu.com" @click="f1">点击弹窗，跳转百度</a>
        <a href="https://www.baidu.com" @click.prevent="f1">点击仅弹窗，但是不跳转</a>
        <br/>
        <input type="text" @keydown.enter="keyfun"/>
    </div>
</body>
<script src="./js/vue.js"></script>
<script>
    Vue.config.devtools = true;
    new Vue({
        el:'#app',
        data: {
            msg: '张三',
        },
        methods: {
            f1() {
                alert('弹窗警告');
            },
            butf(e, content) {
                console.log('当前内容=>', e, content);
            },
            keyfun(event) {
                console.log('当前文本框的值=>', event.target.value);
            }
        }
    })
</script>
</html>